home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
program
/
ixemlsrc.lha
/
ixemul
/
general
/
uname.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-23
|
2KB
|
66 lines
/*
* This file is part of ixemul.library for the Amiga.
* Copyright (C) 1995 Lars G. Hecking
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: uname.c 1.1 1995/12/02 17:49:30 lhecking Exp lhecking $
*
* $Log: uname.c $
* Revision 1.1 1995/12/02 17:49:30 lhecking
* Initial revision
*
*
*/
#include <sys/utsname.h>
#define KERNEL
#include "ixemul.h"
#include "kprintf.h"
#include <stdio.h>
#include <string.h>
static char sysname[] = "AmigaOS";
static char version[] = "1";
static char machine[] = "m68k";
int
uname (struct utsname *name)
{
char host[__SYS_NMLN];
char release[__SYS_NMLN];
int res = -1, err = EFAULT;
if (name)
{
if (gethostname(&host[0],__SYS_NMLN) == 0)
{
sprintf (release, "%d.%d", SysBase->LibNode.lib_Version, SysBase->SoftVer);
strncpy (name->sysname, sysname,__SYS_NMLN);
strncpy (name->nodename, &host[0],__SYS_NMLN);
strncpy (name->release, release,__SYS_NMLN);
strncpy (name->version, version,__SYS_NMLN);
strncpy (name->machine, machine,__SYS_NMLN);
res = err = 0;
}
}
errno = err;
KPRINTF (("&errno = %lx, errno = %ld\n", &errno, errno));
return res;
}